package com.alibaba.cloud.clinic.entity;

import com.alibaba.cloud.clinic.constant.ClinicEnum;
import org.springframework.amqp.rabbit.connection.CorrelationData;

public class NativeCorrelationData extends CorrelationData {

    private String messType;
    private String exchange;
    private String routingKey;
    private Integer maxRetry;
    private String messContent;

    public String getMessType() {
        return messType;
    }

    public void setMessType(String messType) {
        if (messType == null) {
            this.messType = ClinicEnum.MESSAGE_TYPE.TRANSMIT_DATA.getValue();
            return;
        }
        this.messType = messType;

    }

    public String getExchange() {
        return exchange;
    }

    public void setExchange(String exchange) {
        this.exchange = exchange;
    }

    public String getRoutingKey() {
        return routingKey;
    }

    public void setRoutingKey(String routingKey) {
        this.routingKey = routingKey;
    }

    public Integer getMaxRetry() {
        return maxRetry;
    }

    public void setMaxRetry(Integer maxRetry) {
        if (maxRetry == null) {
            this.maxRetry = 0;
            return;
        }
        this.maxRetry = maxRetry;
    }

    public String getMessContent() {
        return messContent;
    }

    public void setMessContent(String messContent) {
        this.messContent = messContent;
    }

    @Override
    public String toString() {
        return "NativeCorrelationData {" +
                "id='" + getId() + '\'' +
                ", messType='" + messType + '\'' +
                ", exchange='" + exchange + '\'' +
                ", routingKey='" + routingKey + '\'' +
                ", maxRetry='" + maxRetry + '\'' +
                ", messContent='" + messContent + '\'' +
                '}';
    }
}
